package com.yhq.oj.judge.sandbox;

import com.yhq.oj.judge.sandbox.impl.ExampleCodeSandBoxImpl;
import com.yhq.oj.judge.sandbox.impl.RemoteCodeSandBoxImpl;
import com.yhq.oj.judge.sandbox.impl.ThirdPartyCodeSandBoxImpl;

/**
 * @program: oj-backend
 * @description: 代码沙箱工厂类
 * @author: HenryYang
 * @create: 2023-08-23 15:58
 **/
public class CodeSandBoxFactory {
    public static CodeSandBox newInstance(String type) {
        switch (type) {
            case "example":
                return new ExampleCodeSandBoxImpl();
            case "remote":
                return new RemoteCodeSandBoxImpl();
            case "thirdParty":
                return new ThirdPartyCodeSandBoxImpl();
            default:
                return new ExampleCodeSandBoxImpl();
        }
    }
}